package com.ruoyi.feiyi.service.impl;

import java.util.Arrays;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.feiyi.mapper.FyApplyUserMapper;
import com.ruoyi.feiyi.domain.FyApplyUser;
import com.ruoyi.feiyi.service.IFyApplyUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 非遗传承人申请Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-26
 */
@Service
public class FyApplyUserServiceImpl extends ServiceImpl<FyApplyUserMapper, FyApplyUser> implements IFyApplyUserService
{

    /**
     * 查询非遗传承人申请
     * 
     * @param id 非遗传承人申请主键
     * @return 非遗传承人申请
     */
    @Override
    public FyApplyUser getInfoById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询非遗传承人申请列表
     * 
     * @param fyApplyUser 非遗传承人申请
     * @return 非遗传承人申请
     */
    @Override
    public List<FyApplyUser> selectList(FyApplyUser fyApplyUser)
    {
        return baseMapper.selectList(fyApplyUser);
    }

    /**
     * 新增非遗传承人申请
     * 
     * @param vo
     * @return 结果
     */
    @Override
    public int insertFyApplyUser(FyApplyUser vo)
    {
        vo.setCreateTime(DateUtils.getNowDate());
        this.save(vo);
        return 1;
    }

    /**
     * 修改非遗传承人申请
     * 
     * @param fyApplyUser 非遗传承人申请
     * @return 结果
     */
    @Override
    public int updateFyApplyUser(FyApplyUser fyApplyUser)
    {
        fyApplyUser.setUpdateTime(DateUtils.getNowDate());
        this.updateById(fyApplyUser);
        return 1;
    }

    /**
     * 批量删除非遗传承人申请
     * 
     * @param ids 需要删除的非遗传承人申请主键
     * @return 结果
     */
    @Override
    public int deleteFyApplyUserByIds(String ids)
    {
        this.removeByIds(Arrays.asList(Convert.toStrArray(ids)));
        return 1;
    }

    /**
     * 删除非遗传承人申请信息
     * 
     * @param id 非遗传承人申请主键
     * @return 结果
     */
    @Override
    public int deleteFyApplyUserById(Long id)
    {
        this.removeById(id);
        return 1;
    }
}
